package com.zhufeng.jvm.classloader;

public class MyTest1 {

	public static void main(String[] args) {
		System.out.println(MyChild.str);
		System.out.println("====================================");
		System.out.println(MyChild.str2);
		
		// 将MyTest1.class放入根类加载器加载目录会报错java.lang.NoClassDefFoundError: com/zhufeng/jvm/classloader/MySample
//		System.out.println(MySample.class);
	}
	
//	public MyTest1() {
//		System.out.println(MySample.class);
//	}

}

class MyParent {
	public static String str = "hello world";
	
	static {
		System.out.println("MyParent static block");
	}
}

class MyChild extends MyParent {
	
	public static String str2 = "MyChild hello world";
	static {
		System.out.println("MyChild static block");
	}
}
